home *** CD-ROM | disk | FTP | other *** search
/ PC Elektro 3 / PC-Elektro-3-cd1.bin / KBan 2.0 / KBANSRC.LZH / SRC / PROG / KBANDATA / COMPLIST.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-23  |  1.8 KB  |  69 lines

  1. // the declaration of class COMPONENT_LIST
  2. // Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
  3.  
  4. #ifndef _COMPLIST_H_
  5. #define _COMPLIST_H_
  6.  
  7. #include "../common/slist.h"
  8. #include "compelem.h"
  9.  
  10. class COMPONENT_LIST : public extended_list<COMPONENT_ELEMENT> {
  11. public:
  12.   // constructors
  13.  
  14.   COMPONENT_LIST() : extended_list<COMPONENT_ELEMENT>() {}
  15.   COMPONENT_LIST(const COMPONENT_LIST& src) : extended_list<COMPONENT_ELEMENT>(src) {}
  16.  
  17.   // operators
  18.  
  19.   void operator+=(const COMPONENT_LIST& target);
  20.   bool operator==(const COMPONENT_LIST& rval) {
  21.     return false;
  22.   }
  23.  
  24.   // max and min
  25.  
  26.   XY   get_max() const;
  27.   XY   get_min() const;
  28.  
  29.   // block-related
  30.  
  31.   void shift(const XY& ac_dif, COMPONENT_LIST& target) const;
  32.  
  33.   void unselect();
  34.   void select_items_in_block(const XY& ac1, const XY& ac2);
  35.   void collect_selected_items(COMPONENT_LIST& dst) const;
  36.   void remove_selected_items();
  37.  
  38.   // save and load
  39.  
  40.   int    save(FILE_NEW& fp) const;
  41. private:
  42.   typedef void (COMPONENT_LIST::*LOAD_FUNC)(FILE_NEW& fp);
  43.   class LOAD_FUNC_INFO {
  44.   public:
  45.     uint      version;
  46.     LOAD_FUNC func;
  47.     uint operator()() const { return version; }
  48.   };
  49.   static LOAD_FUNC_INFO load_func_table[];
  50.   void               load_200b18(FILE_NEW& fp);
  51.   uint               load_get_version(FILE_NEW& fp) const;
  52.   LOAD_FUNC          get_load_func(uint version) const;
  53. public:
  54.   int                load_170(FILE_NEW& fp);
  55.   int                load(FILE_NEW& fp);
  56.  
  57.   // miscellaneous
  58.  
  59. public:
  60.   void               collect_aperture(APT_TABLE& apt_pin_table, APT_TABLE& apt_line_table) const;
  61.   COMPONENT_ELEMENT* search(const XY& ac);
  62.   COMPONENT_ELEMENT* search_designator(const char* designator);
  63.  
  64.   void               rotate_90();
  65.   void               limit_drill_size(uint drill);
  66. };
  67.  
  68. #endif /* _COMPLIST_H_ */
  69.